//
//  QGWebViewController.m
//  车福内测
//
//  Created by heew on 16/1/21.
//  Copyright © 2016年 heew. All rights reserved.
//

#import "QGWebViewController.h"
#import "MJRefresh.h"
@interface QGWebViewController ()
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation QGWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSString *urlStr = @"http://www.pgyer.com/my";
    self.navigationItem.title = urlStr;
    NSURL *url = [NSURL URLWithString:urlStr];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];
    __weak typeof(self) weakSelf = self;
    self.webView.scrollView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        [weakSelf.webView reload];
        [weakSelf.webView.scrollView.header endRefreshing];
    }];
    [self setLeftButtonWithImageName:@"long_arrow_left" bgImageName:nil];
    [self setRightButtonWithStateImage:@"long_arrow_right" stateHighlightedImage:nil stateDisabledImage:nil titleName:nil];
}

- (void)leftButtonPressed:(UIButton *)sender {
    [self.webView goBack];
}

- (void)rightButtonPressed:(UIButton *)sender {
    [self.webView goForward];
}

@end
